-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix escaping of dollar symbols in HTMLWriter #1625
Conversation
Previously, Javascript LaTeX engines got confused trying to distinguish between inline delimiters and dollar symbols for actual currency. This works around the problem by wrapping (currency) dollar symbols in a span tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think this is a clever workaround. And doesn't have the potentially breaking aspect of changing the delimiter configuration.
We don't really have good integration tests of the outputs. The best we do currently are the occursin
s in the example builds. Potentially you could add a few tests there -- I think having your snippet in the test/examples
build would be good.
Just a passing thought, beyond the scope of this PR, but in the future we could use Gumbo to parse the generated HTML and then do some sanity checks on the AST. It worked well for generating the outdated version warnings.
@mortenpi how's this? |
Looks good @odow, thanks! |
Previously, Javascript LaTeX engines got confused trying to
distinguish between inline delimiters and dollar symbols for actual
currency. This works around the problem by wrapping (currency) dollar
symbols in a span tag.
Closes #890
I could use come pointers on how to test this properly. (Is there a way to test the output of the rendered HTML?) I got confused with the structure of
/test
. Here's my more-involved local test: